import http from '../utils/axios';

interface getData {
  id?: any;
  date?: string;
  num?: number;
  size?: number;
  sort?: number;
  state?: number;
  title?: string;
  advance?: string;
  create?: string;
  end?: string;
  price?: number;
  sport?: number;
  time?: string;
  goods?: any;
  start?: any;
  trTitle?: string;
  trMileage?: number;
  trType?: number;
  trGoods?: string;
  trCreate?: string;
  trStart?: string;
  trEnd?: string;
  trAdvance?: string;
  trState?: number;
  img?: string;
  sernum?: string;
  sell?: number;
  rec?: string;
  seat?: any;
  standard?: any;
  type?: any;
  pro?: number;
}

//获取所有促销商品
export const getPromotional = (params: getData) => {
  return http.post<any>('/other/shopping-mall/promotion/findAll', params);
};

//获取参加促销商品
export const findGoods = (params: getData) => {
  return http.post<any>('/other/shopping-mall/promotion/findGoods', params);
};

//获取所有抵扣商品
export const getDeduction = (params: getData) => {
  return http.post<any>('/other/shopping-mall/deduction/findAll', params);
};

//获取所有抢购商品
export const getPurchase = (params: getData) => {
  return http.post<any>('/other/shopping-mall/rush/findAll', params);
};

//促销商品上下架
export const getCircuit = (data: getData) => {
  return http.get<any>('/other/shopping-mall/promotion/state', data);
};

//抢购商品上下架
export const getCircuits = (data: getData) => {
  return http.get<any>('/other/shopping-mall/rush/updateState', data);
};

//获取行程内容
export const getRoute = (params: null) => {
  return http.get<any>('/other/shopping-mall/deduction/addInt', params);
};

//添加促销商品
export const addPromotional = (params: getData) => {
  return http.post<any>('/other/shopping-mall/promotion/add', params);
};

//添加抢购商品/shopping-mall/rush/add
export const addPurchase = (params: getData) => {
  return http.post<any>('/other/shopping-mall/rush/add', params);
};

//删除促销商品
export const deletePromotional = (data: getData) => {
  return http.get<any>('/other/shopping-mall/promotion/del', data);
};

//删除抢购商品
export const deletePurchase = (data: getData) => {
  return http.get<any>('/other/shopping-mall/rush/deleteOne', data);
};

//删除商品管理里面的商品/shopping-mall/promotion/delGoods
export const deleteOne = (params: getData) => {
  return http.post<any>('/other/shopping-mall/promotion/delGoods', params);
};

//删除多个抢购/shopping-mall/rush/deleteS
export const deleteS = (params: getData) => {
  return http.post<any>('/other/shopping-mall/rush/deleteS', params);
};

//模糊查询抢购商品
export const serchPurchase = (params: getData) => {
  return http.post<any>('/other/shopping-mall/rush/dim', params);
};

//修改抢购商品 /shopping-mall/rush/updateById
export const updateById = (params: getData) => {
  return http.post<any>('/other/shopping-mall/rush/updateById', params);
};

//查询所有商品/shopping-mall/rush/findAllGoods
export const findAllGoods = (data: null) => {
  return http.get<any>('/other/shopping-mall/rush/findAllGoods', data);
};

//删除抵扣/shopping-mall/deduction/deleteDeduction
export const deleteDeduction = (data: getData) => {
  return http.get<any>('/other/shopping-mall/deduction/deleteDeduction', data);
};

//抵扣上下架更改/shopping-mall/deduction/updateState
export const updateState = (data: getData) => {
  return http.get<any>('/other/shopping-mall/deduction/updateState', data);
};

//查询抵扣商品/shopping-mall/deduction/dimFind
export const dimFind = (params: getData) => {
  return http.post<any>('/other/shopping-mall/deduction/dimFind', params);
};

//修改抵扣商品/shopping-mall/deduction/updateDeStandardById
export const updateDeStandardById = (params: getData) => {
  return http.post<any>(
    '/other/shopping-mall/deduction/updateDeStandardById',
    params
  );
};

//查询所有行程/shopping-mall/deduction/addInt
export const addInt = (data: null) => {
  return http.get<any>('/other/shopping-mall/deduction/addInt', data);
};

//添加抵扣管理/shopping-mall/deduction/add
export const adddeduction = (params: getData) => {
  return http.post<any>('/other/shopping-mall/deduction/add', params);
};

//获取所有运动品牌和分类/shopping-mall/promotion/initAdd
export const initAdd = (data: null) => {
  return http.get<any>('/other/shopping-mall/promotion/initAdd', data);
};

//根据一级分类查询二级分类 /shopping-mall/promotion/findTwo
export const findTwo = (data: getData) => {
  return http.get<any>('/other/shopping-mall/promotion/findTwo', data);
};

//查询不在促销的商品/shopping-mall/promotion/findGoodsByIdNotInVo
export const findGoodsByIdNotInVo = (params: getData) => {
  return http.post<any>(
    '/other/shopping-mall/promotion/findGoodsByIdNotInVo',
    params
  );
};

//添加不在促销里面的商品​/shopping-mall​/promotion​/addToPro
export const addToPro = (params: getData) => {
  return http.post<any>('/other/shopping-mall/promotion/addToPro', params);
};
